package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the MOVIMIENTO database table.
 * 
 */
@Entity
@Table(name="MOVIMIENTO")
public class Movimiento implements Serializable {
	private static final long serialVersionUID = 1L;
	private long movimientoId;
	private Date fecHor;
	private String fgAsig;
	private BigDecimal montoFin;
	private String tpoMov;
	private Set<Abono> abonos;
	private Set<Consumo> consumos;
	private LineaPrepago lineaPrepago;
	private Set<PagoEnLinea> pagoEnLineas;

    public Movimiento() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="MOVIMIENTO_ID", unique=true, nullable=false)
	public long getMovimientoId() {
		return this.movimientoId;
	}

	public void setMovimientoId(long movimientoId) {
		this.movimientoId = movimientoId;
	}


    @Temporal( TemporalType.DATE)
	@Column(name="FEC_HOR", nullable=false)
	public Date getFecHor() {
		return this.fecHor;
	}

	public void setFecHor(Date fecHor) {
		this.fecHor = fecHor;
	}


	@Column(name="FG_ASIG", length=1)
	public String getFgAsig() {
		return this.fgAsig;
	}

	public void setFgAsig(String fgAsig) {
		this.fgAsig = fgAsig;
	}


	@Column(name="MONTO_FIN", nullable=false, precision=12, scale=2)
	public BigDecimal getMontoFin() {
		return this.montoFin;
	}

	public void setMontoFin(BigDecimal montoFin) {
		this.montoFin = montoFin;
	}


	@Column(name="TPO_MOV", nullable=false, length=1)
	public String getTpoMov() {
		return this.tpoMov;
	}

	public void setTpoMov(String tpoMov) {
		this.tpoMov = tpoMov;
	}


	//bi-directional many-to-one association to Abono
	@OneToMany(mappedBy="movimiento")
	public Set<Abono> getAbonos() {
		return this.abonos;
	}

	public void setAbonos(Set<Abono> abonos) {
		this.abonos = abonos;
	}
	

	//bi-directional many-to-one association to Consumo
	@OneToMany(mappedBy="movimiento")
	public Set<Consumo> getConsumos() {
		return this.consumos;
	}

	public void setConsumos(Set<Consumo> consumos) {
		this.consumos = consumos;
	}
	

	//bi-directional many-to-one association to LineaPrepago
    @ManyToOne
	@JoinColumn(name="LINEA_PREPAGO_ID", nullable=false)
	public LineaPrepago getLineaPrepago() {
		return this.lineaPrepago;
	}

	public void setLineaPrepago(LineaPrepago lineaPrepago) {
		this.lineaPrepago = lineaPrepago;
	}
	

	//bi-directional many-to-one association to PagoEnLinea
	@OneToMany(mappedBy="movimiento")
	public Set<PagoEnLinea> getPagoEnLineas() {
		return this.pagoEnLineas;
	}

	public void setPagoEnLineas(Set<PagoEnLinea> pagoEnLineas) {
		this.pagoEnLineas = pagoEnLineas;
	}
	
}